import request from '@/utils/request'

const serve = {
	list: '/products/list',
	fileList: '/products/file/list',
	coreList: '/products/core/list',
	creat: '/products/add',
	edit: '/products/change',
	Delete: '/products/delete',
	fileCreat: '/products/file/add',
	coreCreat: '/products/core/add',
}

/**
 * login func
 * parameter: {
 *     username: '',
 *     password: '',
 *     captcha: '12345'
 * }
 * @param parameter
 * @returns {*}
 */
// 获取列表
export function serveList (parameter) {
  return request({
    url: serve.list,
    method: 'get',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8',
		},
    params: parameter,
  })
}
// 获取技术手册列表
export function serveFileList (parameter) {
  return request({
    url: serve.fileList,
    method: 'get',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8',
		},
    params: parameter,
  })
}

// 获取功能/核心优势列表
export function serveCoreList (parameter) {
  return request({
    url: serve.coreList,
    method: 'get',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8',
		},
    params: parameter,
  })
}

// 创建功能/核心手册
export function serveCoreCreat (parameter) {
  return request({
    url: serve.coreCreat,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
	 data: parameter,
  })
}

// 创建
export function serveCreat (parameter) {
  return request({
    url: serve.creat,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
	 data: parameter,
  })
}

// 创建技术手册
export function serveFileCreat (parameter) {
  return request({
    url: serve.fileCreat,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
	 data: parameter,
  })
}

// 编辑
export function serveEdit (parameter) {
  return request({
    url: serve.edit,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
	 data: parameter,
  })
}
// 删除
export function serveDelete (parameter) {
  return request({
    url: serve.Delete,
    method: 'post',
		headers: {
		  'Content-Type': 'application/json;charset=UTF-8'
		},
	 data: parameter,
  })
}

